3.45 \(\int \frac{(d+e x) (A+B x+C x^2)}{a+c x^2} \, dx\)

Optimal. Leaf size=93 \[ \frac{\log \left (a+c x^2\right ) (-a C e+A c e+B c d)}{2 c^2}+\frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) (A c d-a (B e+C d))}{\sqrt{a} c^{3/2}}+\frac{x (B e+C d)}{c}+\frac{C e x^2}{2 c} \]

[Out]

((C*d + B*e)*x)/c + (C*e*x^2)/(2*c) + ((A*c*d - a*(C*d + B*e))*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*c^(3/2))
+ ((B*c*d + A*c*e - a*C*e)*Log[a + c*x^2])/(2*c^2)

________________________________________________________________________________________

Rubi [A]  time = 0.117307, antiderivative size = 93, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.16, Rules used = {1629, 635, 205, 260} \[ \frac{\log \left (a+c x^2\right ) (-a C e+A c e+B c d)}{2 c^2}+\frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) (A c d-a (B e+C d))}{\sqrt{a} c^{3/2}}+\frac{x (B e+C d)}{c}+\frac{C e x^2}{2 c} \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x)*(A + B*x + C*x^2))/(a + c*x^2),x]

[Out]

((C*d + B*e)*x)/c + (C*e*x^2)/(2*c) + ((A*c*d - a*(C*d + B*e))*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*c^(3/2))
+ ((B*c*d + A*c*e - a*C*e)*Log[a + c*x^2])/(2*c^2)

Rule 1629

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*
Pq*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

\begin{align*} \int \frac{(d+e x) \left (A+B x+C x^2\right )}{a+c x^2} \, dx &=\int \left (\frac{C d+B e}{c}+\frac{C e x}{c}+\frac{A c d-a (C d+B e)+(B c d+A c e-a C e) x}{c \left (a+c x^2\right )}\right ) \, dx\\ &=\frac{(C d+B e) x}{c}+\frac{C e x^2}{2 c}+\frac{\int \frac{A c d-a (C d+B e)+(B c d+A c e-a C e) x}{a+c x^2} \, dx}{c}\\ &=\frac{(C d+B e) x}{c}+\frac{C e x^2}{2 c}+\frac{(B c d+A c e-a C e) \int \frac{x}{a+c x^2} \, dx}{c}+\frac{(A c d-a (C d+B e)) \int \frac{1}{a+c x^2} \, dx}{c}\\ &=\frac{(C d+B e) x}{c}+\frac{C e x^2}{2 c}+\frac{(A c d-a (C d+B e)) \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right )}{\sqrt{a} c^{3/2}}+\frac{(B c d+A c e-a C e) \log \left (a+c x^2\right )}{2 c^2}\\ \end{align*}

Mathematica [A]  time = 0.109622, size = 86, normalized size = 0.92 \[ \frac{\log \left (a+c x^2\right ) (-a C e+A c e+B c d)-\frac{2 \sqrt{c} \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) (a B e+a C d-A c d)}{\sqrt{a}}+c x (2 B e+2 C d+C e x)}{2 c^2} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x)*(A + B*x + C*x^2))/(a + c*x^2),x]

[Out]

(c*x*(2*C*d + 2*B*e + C*e*x) - (2*Sqrt[c]*(-(A*c*d) + a*C*d + a*B*e)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/Sqrt[a] + (B
*c*d + A*c*e - a*C*e)*Log[a + c*x^2])/(2*c^2)

________________________________________________________________________________________

Maple [A]  time = 0.05, size = 133, normalized size = 1.4 \begin{align*}{\frac{Ce{x}^{2}}{2\,c}}+{\frac{Bex}{c}}+{\frac{Cdx}{c}}+{\frac{\ln \left ( c{x}^{2}+a \right ) Ae}{2\,c}}+{\frac{\ln \left ( c{x}^{2}+a \right ) Bd}{2\,c}}-{\frac{\ln \left ( c{x}^{2}+a \right ) aCe}{2\,{c}^{2}}}+{Ad\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}-{\frac{aBe}{c}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}-{\frac{Cad}{c}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)*(C*x^2+B*x+A)/(c*x^2+a),x)

[Out]

1/2*C*e*x^2/c+1/c*B*e*x+1/c*C*d*x+1/2/c*ln(c*x^2+a)*A*e+1/2/c*ln(c*x^2+a)*B*d-1/2/c^2*ln(c*x^2+a)*a*C*e+1/(a*c
)^(1/2)*arctan(x*c/(a*c)^(1/2))*A*d-1/c/(a*c)^(1/2)*arctan(x*c/(a*c)^(1/2))*a*B*e-1/c/(a*c)^(1/2)*arctan(x*c/(
a*c)^(1/2))*C*a*d

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(C*x^2+B*x+A)/(c*x^2+a),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.84328, size = 468, normalized size = 5.03 \begin{align*} \left [\frac{C a c e x^{2} -{\left (B a e +{\left (C a - A c\right )} d\right )} \sqrt{-a c} \log \left (\frac{c x^{2} + 2 \, \sqrt{-a c} x - a}{c x^{2} + a}\right ) + 2 \,{\left (C a c d + B a c e\right )} x +{\left (B a c d -{\left (C a^{2} - A a c\right )} e\right )} \log \left (c x^{2} + a\right )}{2 \, a c^{2}}, \frac{C a c e x^{2} - 2 \,{\left (B a e +{\left (C a - A c\right )} d\right )} \sqrt{a c} \arctan \left (\frac{\sqrt{a c} x}{a}\right ) + 2 \,{\left (C a c d + B a c e\right )} x +{\left (B a c d -{\left (C a^{2} - A a c\right )} e\right )} \log \left (c x^{2} + a\right )}{2 \, a c^{2}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(C*x^2+B*x+A)/(c*x^2+a),x, algorithm="fricas")

[Out]

[1/2*(C*a*c*e*x^2 - (B*a*e + (C*a - A*c)*d)*sqrt(-a*c)*log((c*x^2 + 2*sqrt(-a*c)*x - a)/(c*x^2 + a)) + 2*(C*a*
c*d + B*a*c*e)*x + (B*a*c*d - (C*a^2 - A*a*c)*e)*log(c*x^2 + a))/(a*c^2), 1/2*(C*a*c*e*x^2 - 2*(B*a*e + (C*a -
 A*c)*d)*sqrt(a*c)*arctan(sqrt(a*c)*x/a) + 2*(C*a*c*d + B*a*c*e)*x + (B*a*c*d - (C*a^2 - A*a*c)*e)*log(c*x^2 +
 a))/(a*c^2)]

________________________________________________________________________________________

Sympy [B]  time = 2.20166, size = 335, normalized size = 3.6 \begin{align*} \frac{C e x^{2}}{2 c} + \left (- \frac{- A c e - B c d + C a e}{2 c^{2}} - \frac{\sqrt{- a c^{5}} \left (- A c d + B a e + C a d\right )}{2 a c^{4}}\right ) \log{\left (x + \frac{A a c e + B a c d - C a^{2} e - 2 a c^{2} \left (- \frac{- A c e - B c d + C a e}{2 c^{2}} - \frac{\sqrt{- a c^{5}} \left (- A c d + B a e + C a d\right )}{2 a c^{4}}\right )}{- A c^{2} d + B a c e + C a c d} \right )} + \left (- \frac{- A c e - B c d + C a e}{2 c^{2}} + \frac{\sqrt{- a c^{5}} \left (- A c d + B a e + C a d\right )}{2 a c^{4}}\right ) \log{\left (x + \frac{A a c e + B a c d - C a^{2} e - 2 a c^{2} \left (- \frac{- A c e - B c d + C a e}{2 c^{2}} + \frac{\sqrt{- a c^{5}} \left (- A c d + B a e + C a d\right )}{2 a c^{4}}\right )}{- A c^{2} d + B a c e + C a c d} \right )} + \frac{x \left (B e + C d\right )}{c} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(C*x**2+B*x+A)/(c*x**2+a),x)

[Out]

C*e*x**2/(2*c) + (-(-A*c*e - B*c*d + C*a*e)/(2*c**2) - sqrt(-a*c**5)*(-A*c*d + B*a*e + C*a*d)/(2*a*c**4))*log(
x + (A*a*c*e + B*a*c*d - C*a**2*e - 2*a*c**2*(-(-A*c*e - B*c*d + C*a*e)/(2*c**2) - sqrt(-a*c**5)*(-A*c*d + B*a
*e + C*a*d)/(2*a*c**4)))/(-A*c**2*d + B*a*c*e + C*a*c*d)) + (-(-A*c*e - B*c*d + C*a*e)/(2*c**2) + sqrt(-a*c**5
)*(-A*c*d + B*a*e + C*a*d)/(2*a*c**4))*log(x + (A*a*c*e + B*a*c*d - C*a**2*e - 2*a*c**2*(-(-A*c*e - B*c*d + C*
a*e)/(2*c**2) + sqrt(-a*c**5)*(-A*c*d + B*a*e + C*a*d)/(2*a*c**4)))/(-A*c**2*d + B*a*c*e + C*a*c*d)) + x*(B*e
+ C*d)/c

________________________________________________________________________________________

Giac [A]  time = 1.16521, size = 123, normalized size = 1.32 \begin{align*} -\frac{{\left (C a d - A c d + B a e\right )} \arctan \left (\frac{c x}{\sqrt{a c}}\right )}{\sqrt{a c} c} + \frac{{\left (B c d - C a e + A c e\right )} \log \left (c x^{2} + a\right )}{2 \, c^{2}} + \frac{C c x^{2} e + 2 \, C c d x + 2 \, B c x e}{2 \, c^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(C*x^2+B*x+A)/(c*x^2+a),x, algorithm="giac")

[Out]

-(C*a*d - A*c*d + B*a*e)*arctan(c*x/sqrt(a*c))/(sqrt(a*c)*c) + 1/2*(B*c*d - C*a*e + A*c*e)*log(c*x^2 + a)/c^2
+ 1/2*(C*c*x^2*e + 2*C*c*d*x + 2*B*c*x*e)/c^2